home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / gsdbloo.exe / DEMOE008.PAS < prev    next >
Pascal/Delphi Source File  |  1992-03-02  |  2KB  |  78 lines

  1. program DemoE008;
  2. {------------------------------------------------------------------------------
  3.                           Griffin Solutions Windows
  4.                               Expanded Sample 8
  5.                                  Demo Program
  6.  
  7.        Copyright (c)  Richard F. Griffin
  8.  
  9.        2 March 1992
  10.  
  11.        102 Molded Stone Pl
  12.        Warner Robins, GA  31088
  13.  
  14.        -------------------------------------------------------------
  15.        Demonstration program of Griffin Solutions use of Check_Func_Keys
  16.        virtual method to capture control of function key strokes.  The
  17.        child virtual method will get the opportunity to handle function
  18.        keys before it passes control to the ancestor object.   In this
  19.        example, if a function key is pressed, its number is displayed.
  20.        Otherwise, control is passed to edit the field on the screen.
  21.  
  22.        **********  Not For Use in a TurboVision Environment  **********
  23.  
  24. -------------------------------------------------------------------------------}
  25. uses
  26.    CRT,
  27.    GS_KeyI;
  28.  
  29. type
  30.    MyObjt = Object(GS_KeyI_Objt)
  31.                PROCEDURE Check_Func_Keys; virtual;
  32.                CONSTRUCTOR Init;
  33.             end;
  34.  
  35. var
  36.    MyKeyIn : MyObjt;
  37.    DumyStr : string;
  38.  
  39. CONSTRUCTOR MyObjt.Init;
  40. begin
  41.    GS_KeyI_Objt.Init;
  42. end;
  43.  
  44. PROCEDURE MyObjt.Check_Func_Keys;
  45. var
  46.    i : integer;
  47. begin
  48.    i := 0;
  49.    case Ch of
  50.       Kbd_F1    :  i := 1;
  51.       Kbd_F2    :  i := 2;
  52.       Kbd_F3    :  i := 3;
  53.       Kbd_F4    :  i := 4;
  54.       Kbd_F5    :  i := 5;
  55.       Kbd_F6    :  i := 6;
  56.       Kbd_F7    :  i := 7;
  57.       Kbd_F8    :  i := 8;
  58.       Kbd_F9    :  i := 9;
  59.       Kbd_F10   :  i := 10;
  60.       else GS_KeyI_Objt.Check_Func_Keys;
  61.    end;
  62.    if i > 0 then
  63.    begin
  64.       gotoxy(10,20);
  65.       write('':25);
  66.       gotoxy(10,20);
  67.       write('Function Key ',i,' Pressed');
  68.    end;
  69. end;
  70.  
  71. begin
  72.    ClrScr;
  73.    MyKeyIn.Init;
  74.    DumyStr := 'TEST Line';
  75.    DumyStr := MyKeyIn.EditString(DumyStr,5,5,20);
  76. end.
  77.  
  78.